﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Classwork03
{
    class Rectangle:Graph
    {
        private string shape;
        private double length;
        private double width;

        public Rectangle(double _length, double _width, string _shape) : base(_shape)
        {
            length = _length;
            width = _width;
            this.shape = base.shape;
        }

        public override double CalculateArea()
        {
            return length * width;
        }

        public override bool IsLegal()
        {
            if (length > 0 && width > 0 && shape == "Rectangle")
                return true;
            else
                return false;
        }
    }
}
